package org.hello.spring;

import org.hello.spring.persistence.dao.UserDao;
import org.hello.spring.persistence.entities.User;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Application {
	public static void main(String[] args) {
		ApplicationContext appContext = new ClassPathXmlApplicationContext(
				"beans.xml");
		UserDao userDao = (UserDao) appContext.getBean("userDao");
		for (int i = 1; i < 5; i++) {
			User user = (User) appContext.getBean("user-"+i);
			userDao.save(user);
			
		}
	}
}
